﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SampleDataTools
{
    public class NgxuCommand
    {
        private EventHandler OnClick;

        public NgxuCommand(EventHandler clickHandler)
        {
            OnClick = clickHandler;
            _Enabled = true;
            _Visible = true;
            ForeColor = Color.Empty;
            BackColor = Color.Empty;
        }

        public event EventHandler TitleChanged;

        public event EventHandler SymbolChanged;

        public event EventHandler EnabledChanged;

        public event EventHandler VisibleChanged;

        public event EventHandler ForeColorChanged;

        public event EventHandler BackColorChanged;

        public void Execute()
        {
            OnClick(this, EventArgs.Empty);
        }

        private string _Symbol;

        public string Symbol
        {
            get { return _Symbol; }
            set
            {
                _Symbol = value;
                SymbolChanged?.Invoke(this, EventArgs.Empty);
            }
        }

        private string _Title;

        public string Title
        {
            get { return _Title; }
            set
            {
                _Title = value;
                TitleChanged?.Invoke(this, EventArgs.Empty);
            }
        }

        private bool _Enabled;

        public bool Enabled
        {
            get { return _Enabled; }
            set { _Enabled = value; EnabledChanged?.Invoke(this, EventArgs.Empty); }
        }

        private bool _Visible;

        public bool Visible
        {
            get { return _Visible; }
            set { _Visible = value; VisibleChanged?.Invoke(this, EventArgs.Empty); }
        }

        private Color _ForeColor;

        public Color ForeColor
        {
            get { return _ForeColor; }
            set
            {
                _ForeColor = value;
                ForeColorChanged?.Invoke(this, EventArgs.Empty);
            }
        }

        private Color _BackColor;

        public Color BackColor
        {
            get { return _BackColor; }
            set
            {
                _BackColor = value;
                BackColorChanged?.Invoke(this, EventArgs.Empty);
            }
        }

    }
}
